<%@page import="java.util.HashMap"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Khutro - Control panel</title>

<link rel="stylesheet" type="text/css" href="khutro/css/khutro.css">
<link rel="stylesheet" type="text/css" href="khutro/css/jquery-ui.css">
<script type="text/javascript" src="khutro/js/jq.js"></script>
<script type="text/javascript" src="khutro/js/jq2.js"></script>
<script src="js/jquery-1.8.2.js"></script>
<script type="text/javascript" src="js/search.js"></script>
<script type="text/javascript" src="js/map.js"></script>
<script type="text/javascript" src="khutro/js/superfish.js"></script>
<script
	src="https://maps.googleapis.com/maps/api/js?sensor=false&language=vi"></script>
<script type="text/javascript"><!--
$(document).ready(function() {
	$('#menu > ul').superfish({
		hoverClass	 : 'sfHover',
		pathClass	 : 'overideThisToUse',
		delay		 : 0,
		animation	 : {height: 'show'},
		speed		 : 'normal',
		autoArrows   : false,
		dropShadows  : false, 
		disableHI	 : false, /* set to true to disable hoverIntent detection */
		onInit		 : function(){},
		onBeforeShow : function(){},
		onShow		 : function(){},
		onHide		 : function(){}
	});
	
	$('#menu > ul').css('display', 'block');
});
function clearselect(){
	$( 'select' ).each( function () {
	    if ( $( this ).children().length > 0 ) {
	        $( $( this ).children()[0] ).attr( 'selected', 'selected' );
	        $( this ).change();
	    }
	} );
}
//-->
</script> 
</head>
<body onload="initialize(6);clearselect();">
<c:choose>
<c:when test="${userRoleIdss ==1 }">
<script language="javascript" type="text/javascript">
<!--
var dle_act_lang   = ["Yes", "No", "Enter", "Cancel"];
//-->
</script>
<div id="loading-layer"><div id="loading-layer-text">Please wait...</div></div>

<div id="container">
<div id="header" style="min-width: 1200px">
  <div class="div1">
    <div class="div2"><img src="khutro/images/logo.png" title="Administration" onclick="location = adminloadsystem.action" alt=""></div>
        <div class="div3"><img src="./khutro/images/lock.png" alt="" style="position: relative; top: 3px;">&nbsp;Welcome:  <span><s:property value="#session['displayNamess']" /> (Administrator)</span> &nbsp; <a href="logout.action" class="navigation">Logout</a></div>
      </div>
    <div id="menu" style="min-width: 1160px">
    <ul class="left sf-js-enabled" style="display: block; ">
      <li><a href="adminloadsystem.action" class="top">Quick Links</a>
        <ul style="display: none; visibility: hidden; ">
          <li><a href="checkaddtopic.action">Add PostNews</a></li>
          <li><a href="checkaddsharetopic.action">Add ShareNews</a></li>
          <li><a href="admin-listtopicload.action">Edit (Reviews/Approve) News</a></li>
          <li><a href="adminspamtopicdo.action">Report Topic</a></li>
          <li><a href="admin-locationload.action">Location</a></li>
        </ul>
      </li>
      <li class=""><a class="top">User Management</a>
        <ul style="visibility: hidden; display: none; ">
          <li><a href="admin-userlistload.action">Users</a></li>
          <li><a href="profileuser.action">Admin Profile </a></li>
        </ul>
      </li>
      <li class=""><a class="top" href="adminlogs.action">Activity Logs and Monitors</a>
      </li>
    </ul>
    <ul style="display: block; " class="right sf-js-enabled">
      <li><a href="adminloadsystem.action" class="top">Quick Links</a></li>
      <li style="cursor:pointer !important"><a onclick="window.open('index.action');" class="top">View Live Site</a></li>
<!--      <li><a class="top" href="/admin.jsp?action=logout">Logout</a></li> -->
    </ul>
  </div>
  </div>
<div id="content">

<table align="center" id="main_body" style="width: 98%; ">
    <tbody><tr>
        <td width="4" height="16"><img src="khutro/images/tb_left.gif" width="4" height="16" border="0"></td>
		<td background="khutro/images/tb_top.gif"><img src="khutro/images/tb_top.gif" width="1" height="16" border="0"></td>
		<td width="4"><img src="khutro/images/tb_right.gif" width="3" height="16" border="0"></td>
    </tr>
	<tr>
        <td width="4" background="khutro/images/tb_lt.gif"><img src="khutro/images/tb_lt.gif" width="4" height="1" border="0"></td>
		<td valign="top" style="padding-top:12px; padding-left:13px; padding-right:13px;" bgcolor="#FAFAFA">
		
<div style="padding-top:5px;">
<table width="100%">
    <tbody><tr>
        <td width="4"><img src="khutro/images/tl_lo.gif" width="4" height="4" border="0"></td>
        <td background="khutro/images/tl_oo.gif"><img src="khutro/images/tl_oo.gif" width="1" height="4" border="0"></td>
        <td width="6"><img src="khutro/images/tl_ro.gif" width="6" height="4" border="0"></td>
    </tr>
</tbody></table>
</div>
<!--MAIN area-->
<div style="padding-top:5px;padding-bottom:2px;">
<table width="100%">
    <tbody><tr>
        <td width="4"><img src="khutro/images/tl_lo.gif" width="4" height="4" border="0"></td>
        <td background="khutro/images/tl_oo.gif"><img src="khutro/images/tl_oo.gif" width="1" height="4" border="0"></td>
        <td width="6"><img src="khutro/images/tl_ro.gif" width="6" height="4" border="0"></td>
    </tr>
    <tr>
        <td background="khutro/images/tl_lb.gif"><img src="khutro/images/tl_lb.gif" width="4" height="1" border="0"></td>
        <td style="padding:5px;" bgcolor="#FFFFFF">
<table width="100%">
    <tbody><tr>
        <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Add location:</div></td>
    </tr>
</tbody></table>
<div class="unterline"></div>
<form action="adminlocationdo.action" method="post">
	<input type="hidden" id="latitude" name="latitude"> 
	<input type="hidden" id="longitude" name="longitude">
<table width="100%">

    <tbody>
    
    <tr>
        <td width="266" style="padding:4px;">Name: </td>
        <td width="238"><input class="edit bk" id="locationName" type="text" name="cat_name" maxlength="254"></td>
        <td width="506" rowspan="20"><div id="mapdetailpost"></div></td>
    </tr>
    <tr>
      <td style="padding:4px;">City:</td>
      <td>
      	<select name="city" id="city" class="tbdownlist"
									onchange="initialize1(12)">
									<option value="0">-Thành Phố-</option>
									<s:iterator value="lstProvince">
										<option value="${provinceId}">${provinceName}</option>
									</s:iterator>
								</select>
	  </td>
        </tr>
    <tr>
      <td style="padding:4px;">District: </td>
      <td>
      		<select name="district" id="district" class="tbdownlist"
									onchange="initialize2(15)">
									<option value="0">-Quận/Huyện-</option>
								</select>
      </td>
      </tr>
    <tr>
      <td style="padding:4px;">Type:</td>
      <td><select size="1" name="locationtype" id="locationtype">
									<s:iterator value="lstLocationtypes">
										<option value="${locationTypeId}">${locationTypeName}</option>
									</s:iterator>
      </select></td>
      </tr>
    <tr>
        <td style="padding:4px;">Description:</td>
        <td style="margin-right: 5px"><textarea rows="4" cols="40" id="description"></textarea></td>
        </tr>
    <tr>
        <td style="padding:4px;">&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
        <tr><td style="padding:4px;">&nbsp;</td>
        <td><input type="button" class="buttons" id="submitlocation" value="  Add  " /></td>
        </tr>
        
    
        
    <tr>
      <td colspan="2" background="khutro/images/tl_oo.gif"><img src="khutro/images/tl_oo.gif" width="1" height="4" border="0"></td>
      </tr>
    <tr>
      <td bgcolor="#EFEFEF" colspan="2" style="padding-left:10px;"><div class="navigation">Add City:</div></td>
    </tr>
    <tr>
      <td style="padding:4px;">City Name:</td>
        <td><input class="edit bk" type="text" name="city3" id="city3"/></td>
        </tr>
    <tr><td style="padding:4px;">&nbsp;</td>
        <td><input type="button" class="buttons" id="submitcity" value="  Add  " /></td>
        </tr>
    <tr>
      <td colspan="2" background="khutro/images/tl_oo.gif"><img src="khutro/images/tl_oo.gif" width="1" height="4" border="0"></td>
      </tr>
    <tr>
      <td bgcolor="#EFEFEF" colspan="2" style="padding-left:10px;"><div class="navigation">Add district:</div></td>
    </tr>
    <tr>
      <td style="padding:4px;">District Name:</td>
        <td><input class="edit bk" type="text" name="cat_name2" id="districtName" /></td>
        </tr>
        
        <tr>
      <td style="padding:4px;">City:</td>
      <td><select name="city1" id="city1" class="tbdownlist" onchange="initializek(12)">
									<s:iterator value="lstProvince">
										<option value="${provinceId}">${provinceName}</option>
									</s:iterator>
								</select>
								</td>
        </tr>
    <tr>
    <tr><td style="padding:4px;">&nbsp;</td>
        <td><input type="button" class="buttons" id="submitdistrict" value="  Add  " /></td>
        </tr>
        
    </tbody>
        
</table>
</form>
</td>
        <td background="khutro/images/tl_rb.gif"><img src="khutro/images/tl_rb.gif" width="6" height="1" border="0"></td>
    </tr>
    <tr>
        <td><img src="khutro/images/tl_lu.gif" width="4" height="6" border="0"></td>
        <td background="khutro/images/tl_ub.gif"><img src="khutro/images/tl_ub.gif" width="1" height="6" border="0"></td>
        <td><img src="khutro/images/tl_ru.gif" width="6" height="6" border="0"></td>
    </tr>
</tbody></table>
</div>
<div style="padding-top:5px;padding-bottom:2px;">
<table width="100%">
    <tbody><tr>
        <td width="4"><img src="khutro/images/tl_lo.gif" width="4" height="4" border="0"></td>
        <td background="khutro/images/tl_oo.gif"><img src="khutro/images/tl_oo.gif" width="1" height="4" border="0"></td>
        <td width="6"><img src="khutro/images/tl_ro.gif" width="6" height="4" border="0"></td>
    </tr>
    <tr>
        <td background="khutro/images/tl_lb.gif"><img src="khutro/images/tl_lb.gif" width="4" height="1" border="0"></td>
        <td style="padding:5px;" bgcolor="#FFFFFF">
<form id="viewlocation" action="listLocation.acion" method="post">
<table width="100%">
    <tbody><tr>
        <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">City:
          <select name="city2" id="city2" class="tbdownlist">
          	<option value="0">-Thành Phố-</option>
									<s:iterator value="lstProvince">
										<option value="${provinceId}">${provinceName}</option>
									</s:iterator>
								</select>
         District: 
         <select name="district2" id="district2" class="tbdownlist">
									<option value="0">-Quận/Huyện-</option>
								</select>
         Type: 
         <select size="1" name="locationtype" id="locationtype2">
									<s:iterator value="lstLocationtypes">
											<option value="${locationTypeId}">${locationTypeName}</option>
										
									</s:iterator>
      </select>
        </div></td>
    </tr>
</tbody></table>
</form>
<div class="unterline"></div>
<table width="100%">
    
	    <tr>
	        <td width="12" style="padding:2px;">ID</td>
	        <td width="31" style="padding:2px;">&nbsp;</td>
	        <td width="265"><span id="locationtypeName">Trường Đại Học, Cao Đẳng</span></td>
	        <td width="85">Tọa Độ</td>
	        <td width="16">&nbsp;</td>
	        <td width="19">&nbsp;</td>
	        <td width="30">Action:</td>
	    </tr>
	    <tr>
	        <td colspan="7"><div class="hr_line"></div></td>
	    </tr>
	    <tbody id="listlocal">
	    <s:iterator value="lstLocation">
	    
   		<tr >
						<td height="14">&nbsp;<b>${locationId}</b></td>
						<td height="20">&nbsp;</td>
						<td>${locationName}</td>
						<td>${latitude},${longitude}</td><td>&nbsp;</td><td>&nbsp;</td>
						<td class="list"><nobr>[<a class="maintitle" onclick="deletelocation(${locationId})" href="javascript:void(0);">Remove</a>]</nobr></td>
						</tr>
						<tr><td background="./category_files/mline.gif" height="1" colspan="7"></td></tr>
		
						</s:iterator>
     </tbody></table>
</td>
        <td background="khutro/images/tl_rb.gif"><img src="khutro/images/tl_rb.gif" width="6" height="1" border="0"></td>
    </tr>
    <tr>
        <td><img src="khutro/images/tl_lu.gif" width="4" height="6" border="0"></td>
        <td background="khutro/images/tl_ub.gif"><img src="khutro/images/tl_ub.gif" width="1" height="6" border="0"></td>
        <td><img src="khutro/images/tl_ru.gif" width="6" height="6" border="0"></td>
    </tr>
</tbody></table>
</div>	 <!--MAIN area-->
	<div style="height:8px; display:block"></div>

		</td>
		<td width="4" background="khutro/images/tb_rt.gif"><img src="khutro/images/tb_rt.gif" width="4" height="1" border="0"></td>
    </tr>
	<tr>
        <td height="16" background="khutro/images/tb_lb.gif"></td>
		<td background="khutro/images/tb_tb.gif"></td>
		<td background="khutro/images/tb_rb.gif"></td>
    </tr>
</tbody></table>

<div style="padding-bottom:10px;">
<table width="100%">
    <tbody><tr>
        <td height="40" align="center" style="padding-right:10px;background: #FAFAFA url('engine/skins/images/footer.gif') repeat-x 0 0;"><div class="navigation">Fu Team | FSH-Project<br>Copyright 2012©. All rights reserved.</div></td>
    </tr>
</tbody></table></div>	
</div>

</div>

<script language="javascript" type="text/javascript">
<!--
function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}
var main_body_size = getClientWidth();

if (main_body_size > 1300) document.getElementById('main_body').style.width = "1200px";

//-->
</script>


<div id="hintbox" style="width: 250px; left: -500px; top: 611px; visibility: hidden; ">You can assign a separate template for article descriptions. Leave it empty to use default template <b>shortstory.tpl</b></div>
</c:when>
<c:otherwise>
	<c:redirect url="adminlogin.jsp"/>
</c:otherwise>
</c:choose>
</body></html>